
var db = [[1293.65,758.73,394.11,0,0],
[1367.87,695.5,394.11,0,0],
[1442.1,632.28,394.11,0,0],
[1516.32,569.05,565.36,0,0],
[1590.54,505.82,565.36,0,0],
[1664.77,442.59,565.36,0,0],
[1738.99,379.37,696.25,0,0],
[1813.22,316.14,696.25,0,0],
[1887.44,252.91,696.25,0,0],
[1961.66,189.68,696.25,0,0],
[2035.89,126.46,696.25,0,0],
[2110.11,63.23,696.25,450.25,0],
[2184.33,0,696.25,450.25,0],
[2347.8,0,557,450.25,0],
[2511.27,0,417.75,450.25,0],
[2674.74,0,278.5,690.38,0],
[2838.2,0,139.25,690.38,0],
[3001.67,0,0,690.38,0],
[3001.67,0,0,900.5,0],
[3001.67,0,0,900.5,0],
[3001.67,0,0,900.5,0],
[3001.67,0,0,900.5,0],
[4058.78,0,0,0,0],
[4058.78,0,0,0,608.82],
[4058.78,0,0,0,608.82],
[4058.78,0,0,0,608.82],
[4058.78,0,0,0,608.82],
[4058.78,0,0,0,608.82],
[4058.78,0,0,0,608.82],
[4773.48,0,0,0,365.29],
[4773.48,0,0,0,365.29],
[4773.48,0,0,0,365.29],
[4773.48,0,0,0,365.29],
[4773.48,0,0,0,365.29],
[4773.48,0,0,0,365.29],
[5202.3,0,0,0,0],
[1300.56,760.11,395.35,0,0],
[1374.92,696.77,395.35,0,0],
[1449.28,633.43,395.35,0,0],
[1523.64,570.08,567.27,0,0],
[1598,506.74,567.27,0,0],
[1672.35,443.4,567.27,0,0],
[1746.71,380.06,698.67,0,0],
[1821.07,316.71,698.67,0,0],
[1895.43,253.37,698.67,0,0],
[1969.79,190.03,698.67,0,0],
[2044.15,126.69,698.67,0,0],
[2118.51,63.34,698.67,451.96,0],
[2192.87,0,698.67,451.96,0],
[2356.9,0,558.89,451.96,0],
[2520.94,0,419.2,451.96,0],
[2684.97,0,279.47,693,0],
[2849.01,0,139.73,693,0],
[3013.04,0,0,693,0],
[3013.04,0,0,903.91,0],
[3013.04,0,0,903.91,0],
[3013.04,0,0,903.91,0],
[3013.04,0,0,903.91,0],
[4074.15,0,0,0,0],
[4074.15,0,0,0,611.12],
[4074.15,0,0,0,611.12],
[4074.15,0,0,0,611.12],
[4074.15,0,0,0,611.12],
[4074.15,0,0,0,611.12],
[4074.15,0,0,0,611.12],
[4791.55,0,0,0,366.67],
[4791.55,0,0,0,366.67],
[4791.55,0,0,0,366.67],
[4791.55,0,0,0,366.67],
[4791.55,0,0,0,366.67],
[4791.55,0,0,0,366.67],
[5222,0,0,0,0],
[1324.74,764.95,399.7,0,0],
[1399.57,701.2,399.7,0,0],
[1474.4,637.46,399.7,0,0],
[1549.24,573.71,573.96,0,0],
[1624.07,509.97,573.96,0,0],
[1698.9,446.22,573.96,0,0],
[1773.73,382.47,707.14,0,0],
[1848.56,318.73,707.14,0,0],
[1923.39,254.98,707.14,0,0],
[1998.23,191.24,707.14,0,0],
[2073.06,127.49,707.14,0,0],
[2147.89,63.75,707.14,457.93,0],
[2222.72,0,707.14,457.93,0],
[2388.75,0,565.72,457.93,0],
[2554.77,0,424.29,457.93,0],
[2720.79,0,282.86,702.16,0],
[2886.82,0,141.43,702.16,0],
[3052.84,0,0,702.16,0],
[3052.85,0,0,915.86,0],
[3052.85,0,0,915.86,0],
[3052.85,0,0,915.86,0],
[3052.85,0,0,915.86,0],
[4127.98,0,0,0,0],
[4127.98,0,0,0,619.2],
[4127.98,0,0,0,619.2],
[4127.98,0,0,0,619.2],
[4127.98,0,0,0,619.2],
[4127.98,0,0,0,619.2],
[4127.98,0,0,0,619.2],
[4854.86,0,0,0,371.52],
[4854.86,0,0,0,371.52],
[4854.86,0,0,0,371.52],
[4854.86,0,0,0,371.52],
[4854.86,0,0,0,371.52],
[4854.86,0,0,0,371.52],
[5291,0,0,0,0],
[1319.56,763.91,398.77,0,0],
[1394.29,700.25,398.77,0,0],
[1469.02,636.59,398.77,0,0],
[1543.75,572.93,572.53,0,0],
[1618.48,509.27,572.53,0,0],
[1693.21,445.62,572.53,0,0],
[1767.94,381.96,705.33,0,0],
[1842.67,318.3,705.33,0,0],
[1917.4,254.64,705.33,0,0],
[1992.13,190.98,705.33,0,0],
[2066.87,127.32,705.33,0,0],
[2141.6,63.66,705.33,456.65,0],
[2216.33,0,705.33,456.65,0],
[2381.93,0,564.26,456.65,0],
[2547.52,0,423.2,456.65,0],
[2713.12,0,282.13,700.2,0],
[2878.72,0,141.06,700.2,0],
[3044.32,0,0,700.2,0],
[3044.32,0,0,913.3,0],
[3044.32,0,0,913.3,0],
[3044.32,0,0,913.3,0],
[3044.32,0,0,913.3,0],
[4116.45,0,0,0,0],
[4116.45,0,0,0,617.47],
[4116.45,0,0,0,617.47],
[4116.45,0,0,0,617.47],
[4116.45,0,0,0,617.47],
[4116.45,0,0,0,617.47],
[4116.45,0,0,0,617.47],
[4841.3,0,0,0,370.48],
[4841.3,0,0,0,370.48],
[4841.3,0,0,0,370.48],
[4841.3,0,0,0,370.48],
[4841.3,0,0,0,370.48],
[4841.3,0,0,0,370.48],
[5276.22,0,0,0,0],
[1329.92,765.98,400.64,0,0],
[1404.85,702.15,400.64,0,0],
[1479.79,638.32,400.64,0,0],
[1554.72,574.49,575.4,0,0],
[1629.65,510.66,575.4,0,0],
[1704.59,446.82,575.4,0,0],
[1779.52,382.99,708.96,0,0],
[1854.45,319.16,708.96,0,0],
[1929.39,255.33,708.96,0,0],
[2004.32,191.5,708.96,0,0],
[2079.25,127.66,708.96,0,0],
[2154.19,63.83,708.96,459.21,0],
[2229.12,0,708.96,459.21,0],
[2395.57,0,567.17,459.21,0],
[2562.02,0,425.37,459.21,0],
[2728.47,0,283.58,704.12,0],
[2894.92,0,141.79,704.12,0],
[3061.38,0,0,704.12,0],
[3061.37,0,0,918.42,0],
[3061.37,0,0,918.42,0],
[3061.37,0,0,918.42,0],
[3061.37,0,0,918.42,0],
[4139.52,0,0,0,0],
[4139.52,0,0,0,620.93],
[4139.52,0,0,0,620.93],
[4139.52,0,0,0,620.93],
[4139.52,0,0,0,620.93],
[4139.52,0,0,0,620.93],
[4139.52,0,0,0,620.93],
[4868.44,0,0,0,372.56],
[4868.44,0,0,0,372.56],
[4868.44,0,0,0,372.56],
[4868.44,0,0,0,372.56],
[4868.44,0,0,0,372.56],
[4868.44,0,0,0,372.56],
[5305.79,0,0,0,0],
[1340.28,768.06,402.5,0,0],
[1415.42,704.05,402.5,0,0],
[1490.55,640.05,402.5,0,0],
[1565.69,576.04,578.26,0,0],
[1640.82,512.04,578.26,0,0],
[1715.96,448.03,578.26,0,0],
[1791.1,384.03,712.59,0,0],
[1866.23,320.02,712.59,0,0],
[1941.37,256.02,712.59,0,0],
[2016.5,192.01,712.59,0,0],
[2091.64,128.01,712.59,0,0],
[2166.78,64,712.59,461.76,0],
[2241.91,0,712.59,461.76,0],
[2409.21,0,570.07,461.76,0],
[2576.52,0,427.55,461.76,0],
[2743.82,0,285.03,708.03,0],
[2911.13,0,142.52,708.03,0],
[3078.43,0,0,708.03,0],
[3078.43,0,0,923.52,0],
[3078.43,0,0,923.52,0],
[3078.43,0,0,923.52,0],
[3078.43,0,0,923.52,0],
[4162.56,0,0,0,0],
[4162.56,0,0,0,624.38],
[4162.56,0,0,0,624.38],
[4162.56,0,0,0,624.38],
[4162.56,0,0,0,624.38],
[4162.56,0,0,0,624.38],
[4162.56,0,0,0,624.38],
[4895.53,0,0,0,374.63],
[4895.53,0,0,0,374.63],
[4895.53,0,0,0,374.63],
[4895.53,0,0,0,374.63],
[4895.53,0,0,0,374.63],
[4895.53,0,0,0,374.63],
[5335.31,0,0,0,0],
[1371.37,774.27,408.1,0,0],
[1447.11,709.75,408.1,0,0],
[1522.86,645.23,408.1,0,0],
[1598.6,580.71,586.86,0,0],
[1674.35,516.18,586.86,0,0],
[1750.09,451.66,586.86,0,0],
[1825.84,387.14,723.48,0,0],
[1901.58,322.61,723.48,0,0],
[1977.32,258.09,723.48,0,0],
[2053.07,193.57,723.48,0,0],
[2128.81,129.05,723.48,0,0],
[2204.56,64.52,723.48,469.44,0],
[2280.3,0,723.48,469.44,0],
[2450.16,0,578.79,469.44,0],
[2620.02,0,434.09,469.44,0],
[2789.85,0,289.4,719.81,0],
[2959.74,0,144.7,719.81,0],
[3129.6,0,0,719.81,0],
[3129.62,0,0,938.88,0],
[3129.62,0,0,938.88,0],
[3129.62,0,0,938.88,0],
[3129.62,0,0,938.88,0],
[4231.78,0,0,0,0],
[4231.78,0,0,0,634.77],
[4231.78,0,0,0,634.77],
[4231.78,0,0,0,634.77],
[4231.78,0,0,0,634.77],
[4231.78,0,0,0,634.77],
[4231.78,0,0,0,634.77],
[4976.94,0,0,0,380.86],
[4976.94,0,0,0,380.86],
[4976.94,0,0,0,380.86],
[4976.94,0,0,0,380.86],
[4976.94,0,0,0,380.86],
[4976.94,0,0,0,380.86],
[5424.04,0,0,0,0],
[1397.28,779.46,412.76,0,0],
[1473.53,714.5,412.76,0,0],
[1549.78,649.55,412.76,0,0],
[1626.03,584.59,594.03,0,0],
[1702.28,519.64,594.03,0,0],
[1778.54,454.68,594.03,0,0],
[1854.79,389.73,732.56,0,0],
[1931.04,324.77,732.56,0,0],
[2007.29,259.82,732.56,0,0],
[2083.54,194.86,732.56,0,0],
[2159.79,129.91,732.56,0,0],
[2236.04,64.95,732.56,475.84,0],
[2312.29,0,732.56,475.84,0],
[2484.29,0,586.05,475.84,0],
[2656.28,0,439.54,475.84,0],
[2828.27,0,293.03,729.62,0],
[3000.26,0,146.52,729.62,0],
[3172.26,0,0,729.62,0],
[3172.26,0,0,951.68,0],
[3172.26,0,0,951.68,0],
[3172.26,0,0,951.68,0],
[3172.26,0,0,951.68,0],
[4289.45,0,0,0,0],
[4289.45,0,0,0,643.42],
[4289.45,0,0,0,643.42],
[4289.45,0,0,0,643.42],
[4289.45,0,0,0,643.42],
[4289.45,0,0,0,643.42],
[4289.45,0,0,0,643.42],
[5044.77,0,0,0,386.05],
[5044.77,0,0,0,386.05],
[5044.77,0,0,0,386.05],
[5044.77,0,0,0,386.05],
[5044.77,0,0,0,386.05],
[5044.77,0,0,0,386.05],
[5497.96,0,0,0,0],
[1435.28,787.06,419.6,0,0],
[1512.27,721.47,419.6,0,0],
[1589.27,655.88,419.6,0,0],
[1666.26,590.29,604.54,0,0],
[1743.26,524.7,604.54,0,0],
[1820.25,459.12,604.54,0,0],
[1897.25,393.53,745.88,0,0],
[1974.24,327.94,745.88,0,0],
[2051.24,262.35,745.88,0,0],
[2128.23,196.76,745.88,0,0],
[2205.23,131.18,745.88,0,0],
[2282.22,65.59,745.88,485.22,0],
[2359.22,0,745.88,485.22,0],
[2534.33,0,596.7,485.22,0],
[2709.45,0,447.53,485.22,0],
[2884.57,0,298.35,744,0],
[3059.69,0,149.18,744,0],
[3234.81,0,0,744,0],
[3234.81,0,0,970.44,0],
[3234.81,0,0,970.44,0],
[3234.81,0,0,970.44,0],
[3234.81,0,0,970.44,0],
[4374.03,0,0,0,0],
[4374.03,0,0,0,656.1],
[4374.03,0,0,0,656.1],
[4374.03,0,0,0,656.1],
[4374.03,0,0,0,656.1],
[4374.03,0,0,0,656.1],
[4374.03,0,0,0,656.1],
[5144.24,0,0,0,393.66],
[5144.24,0,0,0,393.66],
[5144.24,0,0,0,393.66],
[5144.24,0,0,0,393.66],
[5144.24,0,0,0,393.66],
[5144.24,0,0,0,393.66],
[5606.37,0,0,0,0],
[1328.19,765.64,400.32,0,0],
[1403.09,701.83,400.32,0,0],
[1477.99,638.03,400.32,0,0],
[1552.89,574.23,574.91,0,0],
[1627.79,510.43,574.91,0,0],
[1702.69,446.62,574.91,0,0],
[1777.59,382.82,708.35,0,0],
[1852.49,319.02,708.35,0,0],
[1927.38,255.21,708.35,0,0],
[2002.28,191.41,708.35,0,0],
[2077.18,127.61,708.35,0,0],
[2152.08,63.8,708.35,458.78,0],
[2226.98,0,708.35,458.78,0],
[2393.29,0,566.68,458.78,0],
[2559.6,0,425.01,458.78,0],
[2725.91,0,283.34,703.46,0],
[2892.22,0,141.67,703.46,0],
[3058.52,0,0,703.46,0],
[3058.53,0,0,917.56,0],
[3058.53,0,0,917.56,0],
[3058.53,0,0,917.56,0],
[3058.53,0,0,917.56,0],
[4135.66,0,0,0,0],
[4135.66,0,0,0,620.35],
[4135.66,0,0,0,620.35],
[4135.66,0,0,0,620.35],
[4135.66,0,0,0,620.35],
[4135.66,0,0,0,620.35],
[4135.66,0,0,0,620.35],
[4863.9,0,0,0,372.21],
[4863.9,0,0,0,372.21],
[4863.9,0,0,0,372.21],
[4863.9,0,0,0,372.21],
[4863.9,0,0,0,372.21],
[4863.9,0,0,0,372.21],
[5300.84,0,0,0,0],
[1340.28,768.06,402.5,0,0],
[1415.42,704.05,402.5,0,0],
[1490.55,640.05,402.5,0,0],
[1565.69,576.04,578.26,0,0],
[1640.82,512.04,578.26,0,0],
[1715.96,448.03,578.26,0,0],
[1791.1,384.03,712.59,0,0],
[1866.23,320.02,712.59,0,0],
[1941.37,256.02,712.59,0,0],
[2016.5,192.01,712.59,0,0],
[2091.64,128.01,712.59,0,0],
[2166.78,64,712.59,461.76,0],
[2241.91,0,712.59,461.76,0],
[2409.21,0,570.07,461.76,0],
[2576.52,0,427.55,461.76,0],
[2743.82,0,285.03,708.03,0],
[2911.13,0,142.52,708.03,0],
[3078.43,0,0,708.03,0],
[3078.43,0,0,923.52,0],
[3078.43,0,0,923.52,0],
[3078.43,0,0,923.52,0],
[3078.43,0,0,923.52,0],
[4162.56,0,0,0,0],
[4162.56,0,0,0,624.38],
[4162.56,0,0,0,624.38],
[4162.56,0,0,0,624.38],
[4162.56,0,0,0,624.38],
[4162.56,0,0,0,624.38],
[4162.56,0,0,0,624.38],
[4895.53,0,0,0,374.63],
[4895.53,0,0,0,374.63],
[4895.53,0,0,0,374.63],
[4895.53,0,0,0,374.63],
[4895.53,0,0,0,374.63],
[4895.53,0,0,0,374.63],
[5335.31,0,0,0,0],
[1355.83,771.17,405.3,0,0],
[1431.27,706.9,405.3,0,0],
[1506.71,642.64,405.3,0,0],
[1582.15,578.37,582.56,0,0],
[1657.59,514.11,582.56,0,0],
[1733.03,449.85,582.56,0,0],
[1808.47,385.58,718.04,0,0],
[1883.91,321.32,718.04,0,0],
[1959.35,257.06,718.04,0,0],
[2034.79,192.79,718.04,0,0],
[2110.23,128.53,718.04,0,0],
[2185.67,64.26,718.04,465.6,0],
[2261.11,0,718.04,465.6,0],
[2429.7,0,574.43,465.6,0],
[2598.28,0,430.82,465.6,0],
[2766.86,0,287.21,713.92,0],
[2935.45,0,143.61,713.92,0],
[3104.03,0,0,713.92,0],
[3104.03,0,0,931.2,0],
[3104.03,0,0,931.2,0],
[3104.03,0,0,931.2,0],
[3104.03,0,0,931.2,0],
[4197.18,0,0,0,0],
[4197.18,0,0,0,629.58],
[4197.18,0,0,0,629.58],
[4197.18,0,0,0,629.58],
[4197.18,0,0,0,629.58],
[4197.18,0,0,0,629.58],
[4197.18,0,0,0,629.58],
[4936.25,0,0,0,377.75],
[4936.25,0,0,0,377.75],
[4936.25,0,0,0,377.75],
[4936.25,0,0,0,377.75],
[4936.25,0,0,0,377.75],
[4936.25,0,0,0,377.75],
[5379.69,0,0,0,0],
[1328.19,765.64,400.32,0,0],
[1403.09,701.83,400.32,0,0],
[1477.99,638.03,400.32,0,0],
[1552.89,574.23,574.91,0,0],
[1627.79,510.43,574.91,0,0],
[1702.69,446.62,574.91,0,0],
[1777.59,382.82,708.35,0,0],
[1852.49,319.02,708.35,0,0],
[1927.38,255.21,708.35,0,0],
[2002.28,191.41,708.35,0,0],
[2077.18,127.61,708.35,0,0],
[2152.08,63.8,708.35,458.78,0],
[2226.98,0,708.35,458.78,0],
[2393.29,0,566.68,458.78,0],
[2559.6,0,425.01,458.78,0],
[2725.91,0,283.34,703.46,0],
[2892.22,0,141.67,703.46,0],
[3058.52,0,0,703.46,0],
[3058.53,0,0,917.56,0],
[3058.53,0,0,917.56,0],
[3058.53,0,0,917.56,0],
[3058.53,0,0,917.56,0],
[4135.67,0,0,0,0],
[4135.67,0,0,0,620.35],
[4135.67,0,0,0,620.35],
[4135.67,0,0,0,620.35],
[4135.67,0,0,0,620.35],
[4135.67,0,0,0,620.35],
[4135.67,0,0,0,620.35],
[4863.91,0,0,0,372.21],
[4863.91,0,0,0,372.21],
[4863.91,0,0,0,372.21],
[4863.91,0,0,0,372.21],
[4863.91,0,0,0,372.21],
[4863.91,0,0,0,372.21],
[5300.85,0,0,0,0],
[1345.46,769.09,403.43,0,0],
[1420.7,705,403.43,0,0],
[1495.93,640.91,403.43,0,0],
[1571.17,576.82,579.69,0,0],
[1646.41,512.73,579.69,0,0],
[1721.65,448.64,579.69,0,0],
[1796.88,384.55,714.4,0,0],
[1872.12,320.46,714.4,0,0],
[1947.36,256.36,714.4,0,0],
[2022.6,192.27,714.4,0,0],
[2097.83,128.18,714.4,0,0],
[2173.07,64.09,714.4,463.04,0],
[2248.31,0,714.4,463.04,0],
[2416.04,0,571.52,463.04,0],
[2583.76,0,428.64,463.04,0],
[2751.49,0,285.76,710,0],
[2919.22,0,142.88,710,0],
[3086.95,0,0,710,0],
[3086.96,0,0,926.09,0],
[3086.96,0,0,926.09,0],
[3086.96,0,0,926.09,0],
[3086.96,0,0,926.09,0],
[4174.11,0,0,0,0],
[4174.11,0,0,0,626.12],
[4174.11,0,0,0,626.12],
[4174.11,0,0,0,626.12],
[4174.11,0,0,0,626.12],
[4174.11,0,0,0,626.12],
[4174.11,0,0,0,626.12],
[4909.12,0,0,0,375.67],
[4909.12,0,0,0,375.67],
[4909.12,0,0,0,375.67],
[4909.12,0,0,0,375.67],
[4909.12,0,0,0,375.67],
[4909.12,0,0,0,375.67],
[5350.13,0,0,0,0],
[1402.46,780.49,413.69,0,0],
[1478.81,715.45,413.69,0,0],
[1555.16,650.41,413.69,0,0],
[1631.52,585.37,595.46,0,0],
[1707.87,520.33,595.46,0,0],
[1784.22,455.29,595.46,0,0],
[1860.57,390.25,734.38,0,0],
[1936.93,325.21,734.38,0,0],
[2013.28,260.16,734.38,0,0],
[2089.63,195.12,734.38,0,0],
[2165.98,130.08,734.38,0,0],
[2242.34,65.04,734.38,477.12,0],
[2318.69,0,734.38,477.12,0],
[2491.11,0,587.5,477.12,0],
[2663.53,0,440.63,477.12,0],
[2835.95,0,293.75,731.58,0],
[3008.37,0,146.87,731.58,0],
[3180.79,0,0,731.58,0],
[3180.79,0,0,954.24,0],
[3180.79,0,0,954.24,0],
[3180.79,0,0,954.24,0],
[3180.79,0,0,954.24,0],
[4300.98,0,0,0,0],
[4300.98,0,0,0,645.15],
[4300.98,0,0,0,645.15],
[4300.98,0,0,0,645.15],
[4300.98,0,0,0,645.15],
[4300.98,0,0,0,645.15],
[4300.98,0,0,0,645.15],
[5058.33,0,0,0,387.09],
[5058.33,0,0,0,387.09],
[5058.33,0,0,0,387.09],
[5058.33,0,0,0,387.09],
[5058.33,0,0,0,387.09],
[5058.33,0,0,0,387.09],
[5512.74,0,0,0,0],
[1348.92,769.78,404.06,0,0],
[1424.22,705.64,404.06,0,0],
[1499.53,641.49,404.06,0,0],
[1574.83,577.34,580.65,0,0],
[1650.14,513.19,580.65,0,0],
[1725.44,449.04,580.65,0,0],
[1800.75,384.89,715.62,0,0],
[1876.05,320.74,715.62,0,0],
[1951.36,256.59,715.62,0,0],
[2026.66,192.45,715.62,0,0],
[2101.97,128.3,715.62,0,0],
[2177.27,64.15,715.62,463.9,0],
[2252.58,0,715.62,463.9,0],
[2420.59,0,572.49,463.9,0],
[2588.61,0,429.37,463.9,0],
[2756.62,0,286.24,711.31,0],
[2924.64,0,143.12,711.31,0],
[3092.66,0,0,711.31,0],
[3092.65,0,0,927.8,0],
[3092.65,0,0,927.8,0],
[3092.65,0,0,927.8,0],
[3092.65,0,0,927.8,0],
[4181.8,0,0,0,0],
[4181.8,0,0,0,627.27],
[4181.8,0,0,0,627.27],
[4181.8,0,0,0,627.27],
[4181.8,0,0,0,627.27],
[4181.8,0,0,0,627.27],
[4181.8,0,0,0,627.27],
[4918.16,0,0,0,376.36],
[4918.16,0,0,0,376.36],
[4918.16,0,0,0,376.36],
[4918.16,0,0,0,376.36],
[4918.16,0,0,0,376.36],
[4918.16,0,0,0,376.36],
[5359.98,0,0,0,0],
[1380.01,776,409.65,0,0],
[1455.92,711.34,409.65,0,0],
[1531.84,646.67,409.65,0,0],
[1607.75,582,589.25,0,0],
[1683.66,517.33,589.25,0,0],
[1759.58,452.67,589.25,0,0],
[1835.49,388,726.51,0,0],
[1911.4,323.33,726.51,0,0],
[1987.32,258.67,726.51,0,0],
[2063.23,194,726.51,0,0],
[2139.14,129.33,726.51,0,0],
[2215.06,64.67,726.51,471.57,0],
[2290.97,0,726.51,471.57,0],
[2461.54,0,581.21,471.57,0],
[2632.11,0,435.91,471.57,0],
[2802.68,0,290.61,723.08,0],
[2973.26,0,145.3,723.08,0],
[3143.83,0,0,723.08,0],
[3143.83,0,0,943.15,0],
[3143.83,0,0,943.15,0],
[3143.83,0,0,943.15,0],
[3143.83,0,0,943.15,0],
[4251,0,0,0,0],
[4251,0,0,0,637.65],
[4251,0,0,0,637.65],
[4251,0,0,0,637.65],
[4251,0,0,0,637.65],
[4251,0,0,0,637.65],
[4251,0,0,0,637.65],
[4999.55,0,0,0,382.59],
[4999.55,0,0,0,382.59],
[4999.55,0,0,0,382.59],
[4999.55,0,0,0,382.59],
[4999.55,0,0,0,382.59],
[4999.55,0,0,0,382.59],
[5448.68,0,0,0,0],
[1328.19,765.64,400.32,0,0],
[1403.09,701.83,400.32,0,0],
[1477.99,638.03,400.32,0,0],
[1552.89,574.23,574.91,0,0],
[1627.79,510.43,574.91,0,0],
[1702.69,446.62,574.91,0,0],
[1777.59,382.82,708.35,0,0],
[1852.49,319.02,708.35,0,0],
[1927.38,255.21,708.35,0,0],
[2002.28,191.41,708.35,0,0],
[2077.18,127.61,708.35,0,0],
[2152.08,63.8,708.35,458.78,0],
[2226.98,0,708.35,458.78,0],
[2393.29,0,566.68,458.78,0],
[2559.6,0,425.01,458.78,0],
[2725.91,0,283.34,703.46,0],
[2892.22,0,141.67,703.46,0],
[3058.52,0,0,703.46,0],
[3058.53,0,0,917.56,0],
[3058.53,0,0,917.56,0],
[3058.53,0,0,917.56,0],
[3058.53,0,0,917.56,0],
[4135.66,0,0,0,0],
[4135.66,0,0,0,620.35],
[4135.66,0,0,0,620.35],
[4135.66,0,0,0,620.35],
[4135.66,0,0,0,620.35],
[4135.66,0,0,0,620.35],
[4135.66,0,0,0,620.35],
[4863.9,0,0,0,372.21],
[4863.9,0,0,0,372.21],
[4863.9,0,0,0,372.21],
[4863.9,0,0,0,372.21],
[4863.9,0,0,0,372.21],
[4863.9,0,0,0,372.21],
[5300.84,0,0,0,0],
[1380.01,776,409.65,0,0],
[1455.92,711.34,409.65,0,0],
[1531.84,646.67,409.65,0,0],
[1607.75,582,589.25,0,0],
[1683.66,517.33,589.25,0,0],
[1759.58,452.67,589.25,0,0],
[1835.49,388,726.51,0,0],
[1911.4,323.33,726.51,0,0],
[1987.32,258.67,726.51,0,0],
[2063.23,194,726.51,0,0],
[2139.14,129.33,726.51,0,0],
[2215.06,64.67,726.51,471.57,0],
[2290.97,0,726.51,471.57,0],
[2461.54,0,581.21,471.57,0],
[2632.11,0,435.91,471.57,0],
[2802.68,0,290.61,723.08,0],
[2973.26,0,145.3,723.08,0],
[3143.83,0,0,723.08,0],
[3143.83,0,0,943.15,0],
[3143.83,0,0,943.15,0],
[3143.83,0,0,943.15,0],
[3143.83,0,0,943.15,0],
[4251,0,0,0,0],
[4251,0,0,0,637.65],
[4251,0,0,0,637.65],
[4251,0,0,0,637.65],
[4251,0,0,0,637.65],
[4251,0,0,0,637.65],
[4251,0,0,0,637.65],
[4999.55,0,0,0,382.59],
[4999.55,0,0,0,382.59],
[4999.55,0,0,0,382.59],
[4999.55,0,0,0,382.59],
[4999.55,0,0,0,382.59],
[4999.55,0,0,0,382.59],
[5448.68,0,0,0,0],
[1397.28,779.46,412.76,0,0],
[1473.53,714.5,412.76,0,0],
[1549.78,649.55,412.76,0,0],
[1626.03,584.59,594.03,0,0],
[1702.28,519.64,594.03,0,0],
[1778.54,454.68,594.03,0,0],
[1854.79,389.73,732.56,0,0],
[1931.04,324.77,732.56,0,0],
[2007.29,259.82,732.56,0,0],
[2083.54,194.86,732.56,0,0],
[2159.79,129.91,732.56,0,0],
[2236.04,64.95,732.56,475.84,0],
[2312.29,0,732.56,475.84,0],
[2484.29,0,586.05,475.84,0],
[2656.28,0,439.54,475.84,0],
[2828.27,0,293.03,729.62,0],
[3000.26,0,146.52,729.62,0],
[3172.26,0,0,729.62,0],
[3172.26,0,0,951.68,0],
[3172.26,0,0,951.68,0],
[3172.26,0,0,951.68,0],
[3172.26,0,0,951.68,0],
[4289.45,0,0,0,0],
[4289.45,0,0,0,643.42],
[4289.45,0,0,0,643.42],
[4289.45,0,0,0,643.42],
[4289.45,0,0,0,643.42],
[4289.45,0,0,0,643.42],
[4289.45,0,0,0,643.42],
[5044.77,0,0,0,386.05],
[5044.77,0,0,0,386.05],
[5044.77,0,0,0,386.05],
[5044.77,0,0,0,386.05],
[5044.77,0,0,0,386.05],
[5044.77,0,0,0,386.05],
[5497.96,0,0,0,0],
[1435.28,787.06,419.6,0,0],
[1512.27,721.47,419.6,0,0],
[1589.27,655.88,419.6,0,0],
[1666.26,590.29,604.54,0,0],
[1743.26,524.7,604.54,0,0],
[1820.25,459.12,604.54,0,0],
[1897.25,393.53,745.88,0,0],
[1974.24,327.94,745.88,0,0],
[2051.24,262.35,745.88,0,0],
[2128.23,196.76,745.88,0,0],
[2205.23,131.18,745.88,0,0],
[2282.22,65.59,745.88,485.22,0],
[2359.22,0,745.88,485.22,0],
[2534.33,0,596.7,485.22,0],
[2709.45,0,447.53,485.22,0],
[2884.57,0,298.35,744,0],
[3059.69,0,149.18,744,0],
[3234.81,0,0,744,0],
[3234.81,0,0,970.44,0],
[3234.81,0,0,970.44,0],
[3234.81,0,0,970.44,0],
[3234.81,0,0,970.44,0],
[4374.03,0,0,0,0],
[4374.03,0,0,0,656.1],
[4374.03,0,0,0,656.1],
[4374.03,0,0,0,656.1],
[4374.03,0,0,0,656.1],
[4374.03,0,0,0,656.1],
[4374.03,0,0,0,656.1],
[5144.24,0,0,0,393.66],
[5144.24,0,0,0,393.66],
[5144.24,0,0,0,393.66],
[5144.24,0,0,0,393.66],
[5144.24,0,0,0,393.66],
[5144.24,0,0,0,393.66],
[5606.37,0,0,0,0]];

var db_maestranza = [[1750,0,0,100,156.2,15.6,169.79,16.9,906.25,0,0,100,78.1,7.8,0,0],
[1912.5,30,0,100,168.65,16.8,183.3,18.3,959.06,30,0,100,84.32,8.4,0,0],
[2075,30,0,100,181.1,18.1,196.87,19.6,1011.88,30,0,100,90.54,9.05,0,0],
[2075,30,0,100,181.1,18.1,196.87,19.6,1011.88,30,0,100,90.54,9.05,0,0],
[2075,30,0,100,181.1,18.1,196.87,19.6,1011.88,30,0,100,90.54,9.05,0,0],
[2075,30,0,100,181.1,18.1,196.87,19.6,1011.88,30,0,100,90.54,9.05,0,0],
[2075,30,0,100,181.1,18.1,196.87,19.6,1011.88,30,0,100,90.54,9.05,0,0],
[2075,30,0,100,181.1,18.1,196.87,19.6,1011.88,30,0,100,90.54,9.05,0,0],
[2075,30,0,100,181.1,18.1,196.87,19.6,1011.88,30,0,100,90.54,9.05,0,0],
[2075,30,200,0,181.1,18.1,196.87,19.6,1011.88,30,150,0,90.54,9.05,0,0],
[2075,30,200,100,181.1,18.1,196.87,19.6,1011.88,30,150,50,90.54,9.05,0,0],
[2075,30,200,200,181.1,18.1,196.87,19.6,1011.88,30,150,100,90.54,9.05,0,0],
[2075,30,200,200,181.1,18.1,196.87,19.6,1011.88,30,150,100,90.54,9.05,0,0],
[2075,30,200,200,181.1,18.1,196.87,19.6,1011.88,30,150,100,90.54,9.05,0,0],
[2225,80,200,200,200,20,215,21.5,1086.88,55,150,100,100,10,0,0],
[2225,80,200,200,200,20,215,21.5,1086.88,55,150,100,100,10,0,0],
[2225,250,200,300,200,20,215,21.5,1086.88,140,150,150,100,10,0,0],
[2325,275,200,200,200,20,215,21.5,1136.88,152.5,150,100,100,10,0,0],
[2325,275,200,200,200,20,215,21.5,1136.88,152.5,150,100,100,10,0,0],
[2425,275,200,200,200,29,215,31,1186.88,152.5,150,100,100,14.5,0,0],
[2625,300,200,100,200,38,215,41,1286.88,165,150,50,100,19,0,0],
[2825,325,200,0,200,48,215,51.25,1386.88,177.5,150,0,100,24,0,0],
[2825,325,200,0,200,48,215,51.25,1386.88,177.5,150,0,100,24,0,0],
[2825,325,200,0,200,48,215,51.25,1386.88,177.5,150,0,100,24,0,0],
[2825,325,200,0,200,48,215,51.25,1386.88,177.5,150,0,100,24,0,0],
[2825,325,200,0,200,48,215,51.25,1386.88,177.5,150,0,100,24,0,0],
[3025,325,335,0,220,53,237,57,1485.5,177.5,223,0,110,26.5,0,0],
[3025,325,335,0,220,53,237,57,1485.5,177.5,223,0,110,26.5,0,0],
[3180,450,390,0,240,58,258,62,1562,225,270,0,120,29,0,0],
[3180,450,390,0,240,58,258,62,1562,225,270,0,120,29,0,0],
[3180,450,390,0,240,58,258,62,1562,225,270,0,120,29,0,0],
[3330,450,390,0,249,60,268,64,1639,225,270,0,124.5,30,0,0],
[3330,450,390,0,249,60,268,64,1639,225,270,0,124.5,30,0,0],
[3330,450,390,0,249,60,268,64,1639,225,270,0,124.5,30,0,0],
[3330,450,390,0,249,60,268,64,1639,225,270,0,124.5,30,0,0],
[1751.66,0,0,100,156.2,15.6,169.79,16.9,907.12,0,0,100,78.1,7.8,0,0],
[1914.33,30,0,100,168.65,16.8,183.3,18.3,960,30,0,100,84.32,8.4,0,0],
[2076.98,30,0,100,181.1,18.1,196.87,19.6,1012.86,30,0,100,90.54,9.05,0,0],
[2076.98,30,0,100,181.1,18.1,196.87,19.6,1012.86,30,0,100,90.54,9.05,0,0],
[2076.98,30,0,100,181.1,18.1,196.87,19.6,1012.86,30,0,100,90.54,9.05,0,0],
[2076.98,30,0,100,181.1,18.1,196.87,19.6,1012.86,30,0,100,90.54,9.05,0,0],
[2076.98,30,0,100,181.1,18.1,196.87,19.6,1012.86,30,0,100,90.54,9.05,0,0],
[2076.98,30,0,100,181.1,18.1,196.87,19.6,1012.86,30,0,100,90.54,9.05,0,0],
[2076.98,30,0,100,181.1,18.1,196.87,19.6,1012.86,30,0,100,90.54,9.05,0,0],
[2076.98,30,200,0,181.1,18.1,196.87,19.6,1012.86,30,150,0,90.54,9.05,0,0],
[2076.98,30,200,100,181.1,18.1,196.87,19.6,1012.86,30,150,50,90.54,9.05,0,0],
[2076.98,30,200,200,181.1,18.1,196.87,19.6,1012.86,30,150,100,90.54,9.05,0,0],
[2076.98,30,200,200,181.1,18.1,196.87,19.6,1012.86,30,150,100,90.54,9.05,0,0],
[2076.98,30,200,200,181.1,18.1,196.87,19.6,1012.86,30,150,100,90.54,9.05,0,0],
[2226.98,80,200,200,200,20,215,21.5,1087.86,55,150,100,100,10,0,0],
[2226.98,80,200,200,200,20,215,21.5,1087.86,55,150,100,100,10,0,0],
[2226.98,250,200,300,200,20,215,21.5,1087.86,140,150,150,100,10,0,0],
[2326.98,275,200,200,200,20,215,21.5,1137.86,152.5,150,100,100,10,0,0],
[2326.98,275,200,200,200,20,215,21.5,1137.86,152.5,150,100,100,10,0,0],
[2426.98,275,200,200,200,29,215,31,1187.86,152.5,150,100,100,14.5,0,0],
[2626.98,300,200,100,200,38,215,41,1287.86,165,150,50,100,19,0,0],
[2826.98,325,200,0,200,48,215,51.25,1387.86,177.5,150,0,100,24,0,0],
[2826.98,325,200,0,200,48,215,51.25,1387.86,177.5,150,0,100,24,0,0],
[2826.98,325,200,0,200,48,215,51.25,1387.86,177.5,150,0,100,24,0,0],
[2826.98,325,200,0,200,48,215,51.25,1387.86,177.5,150,0,100,24,0,0],
[2826.98,325,200,0,200,48,215,51.25,1387.86,177.5,150,0,100,24,0,0],
[3026.98,325,335,0,220,53,237,57,1486.49,177.5,223,0,110,26.5,0,0],
[3026.98,325,335,0,220,53,237,57,1486.49,177.5,223,0,110,26.5,0,0],
[3181.98,450,390,0,240,58,258,62,1562.99,225,270,0,120,29,0,0],
[3181.98,450,390,0,240,58,258,62,1562.99,225,270,0,120,29,0,0],
[3181.98,450,390,0,240,58,258,62,1562.99,225,270,0,120,29,0,0],
[3331.98,450,390,0,249,60,268,64,1639.99,225,270,0,124.5,30,0,0],
[3331.98,450,390,0,249,60,268,64,1639.99,225,270,0,124.5,30,0,0],
[3331.98,450,390,0,249,60,268,64,1639.99,225,270,0,124.5,30,0,0],
[3331.98,450,390,0,249,60,268,64,1639.99,225,270,0,124.5,30,0,0],
[1772.33,0,0,100,156.2,15.6,169.79,16.9,917.98,0,0,100,78.1,7.8,0,0],
[1937.16,30,0,100,168.65,16.8,183.3,18.3,971.76,30,0,100,84.32,8.4,0,0],
[2101.63,30,0,100,181.1,18.1,196.87,19.6,1025.19,30,0,100,90.54,9.05,0,0],
[2101.63,30,0,100,181.1,18.1,196.87,19.6,1025.19,30,0,100,90.54,9.05,0,0],
[2101.63,30,0,100,181.1,18.1,196.87,19.6,1025.19,30,0,100,90.54,9.05,0,0],
[2101.63,30,0,100,181.1,18.1,196.87,19.6,1025.19,30,0,100,90.54,9.05,0,0],
[2101.63,30,0,100,181.1,18.1,196.87,19.6,1025.19,30,0,100,90.54,9.05,0,0],
[2101.63,30,0,100,181.1,18.1,196.87,19.6,1025.19,30,0,100,90.54,9.05,0,0],
[2101.63,30,0,100,181.1,18.1,196.87,19.6,1025.19,30,0,100,90.54,9.05,0,0],
[2101.63,30,200,0,181.1,18.1,196.87,19.6,1025.19,30,150,0,90.54,9.05,0,0],
[2101.63,30,200,100,181.1,18.1,196.87,19.6,1025.19,30,150,50,90.54,9.05,0,0],
[2101.63,30,200,200,181.1,18.1,196.87,19.6,1025.19,30,150,100,90.54,9.05,0,0],
[2101.63,30,200,200,181.1,18.1,196.87,19.6,1025.19,30,150,100,90.54,9.05,0,0],
[2101.63,30,200,200,181.1,18.1,196.87,19.6,1025.19,30,150,100,90.54,9.05,0,0],
[2251.63,80,200,200,200,20,215,21.5,1100.19,55,150,100,100,10,0,0],
[2251.63,80,200,200,200,20,215,21.5,1100.19,55,150,100,100,10,0,0],
[2251.63,250,200,300,200,20,215,21.5,1100.19,140,150,150,100,10,0,0],
[2351.63,275,200,200,200,20,215,21.5,1150.19,152.5,150,100,100,10,0,0],
[2351.63,275,200,200,200,20,215,21.5,1150.19,152.5,150,100,100,10,0,0],
[2451.63,275,200,200,200,29,215,31,1200.19,152.5,150,100,100,14.5,0,0],
[2651.63,300,200,100,200,38,215,41,1300.19,165,150,50,100,19,0,0],
[2851.63,325,200,0,200,48,215,51.25,1400.19,177.5,150,0,100,24,0,0],
[2851.63,325,200,0,200,48,215,51.25,1400.19,177.5,150,0,100,24,0,0],
[2851.63,325,200,0,200,48,215,51.25,1400.19,177.5,150,0,100,24,0,0],
[2851.63,325,200,0,200,48,215,51.25,1400.19,177.5,150,0,100,24,0,0],
[2851.63,325,200,0,200,48,215,51.25,1400.19,177.5,150,0,100,24,0,0],
[3051.63,325,335,0,220,53,237,57,1498.81,177.5,223,0,110,26.5,0,0],
[3051.63,325,335,0,220,53,237,57,1498.81,177.5,223,0,110,26.5,0,0],
[3206.63,450,390,0,240,58,258,62,1575.31,225,270,0,120,29,0,0],
[3206.63,450,390,0,240,58,258,62,1575.31,225,270,0,120,29,0,0],
[3206.63,450,390,0,240,58,258,62,1575.31,225,270,0,120,29,0,0],
[3356.63,450,390,0,249,60,268,64,1652.31,225,270,0,124.5,30,0,0],
[3356.63,450,390,0,249,60,268,64,1652.31,225,270,0,124.5,30,0,0],
[3356.63,450,390,0,249,60,268,64,1652.31,225,270,0,124.5,30,0,0],
[3356.63,450,390,0,249,60,268,64,1652.31,225,270,0,124.5,30,0,0],
[1807.9,0,0,100,156.2,15.6,169.79,16.9,936.66,0,0,100,78.1,7.8,0,0],
[1976.43,30,0,100,168.65,16.8,183.3,18.3,991.97,30,0,100,84.32,8.4,0,0],
[2144.02,30,0,100,181.1,18.1,196.87,19.6,1046.39,30,0,100,90.54,9.05,0,0],
[2144.02,30,0,100,181.1,18.1,196.87,19.6,1046.39,30,0,100,90.54,9.05,0,0],
[2144.02,30,0,100,181.1,18.1,196.87,19.6,1046.39,30,0,100,90.54,9.05,0,0],
[2144.02,30,0,100,181.1,18.1,196.87,19.6,1046.39,30,0,100,90.54,9.05,0,0],
[2144.02,30,0,100,181.1,18.1,196.87,19.6,1046.39,30,0,100,90.54,9.05,0,0],
[2144.02,30,0,100,181.1,18.1,196.87,19.6,1046.39,30,0,100,90.54,9.05,0,0],
[2144.02,30,0,100,181.1,18.1,196.87,19.6,1046.39,30,0,100,90.54,9.05,0,0],
[2144.02,30,200,0,181.1,18.1,196.87,19.6,1046.39,30,150,0,90.54,9.05,0,0],
[2144.02,30,200,100,181.1,18.1,196.87,19.6,1046.39,30,150,50,90.54,9.05,0,0],
[2144.02,30,200,200,181.1,18.1,196.87,19.6,1046.39,30,150,100,90.54,9.05,0,0],
[2144.02,30,200,200,181.1,18.1,196.87,19.6,1046.39,30,150,100,90.54,9.05,0,0],
[2144.02,30,200,200,181.1,18.1,196.87,19.6,1046.39,30,150,100,90.54,9.05,0,0],
[2294.02,80,200,200,200,20,215,21.5,1121.39,55,150,100,100,10,0,0],
[2294.02,80,200,200,200,20,215,21.5,1121.39,55,150,100,100,10,0,0],
[2294.02,250,200,300,200,20,215,21.5,1121.39,140,150,150,100,10,0,0],
[2394.02,275,200,200,200,20,215,21.5,1171.39,152.5,150,100,100,10,0,0],
[2394.02,275,200,200,200,20,215,21.5,1171.39,152.5,150,100,100,10,0,0],
[2494.02,275,200,200,200,29,215,31,1221.39,152.5,150,100,100,14.5,0,0],
[2694.02,300,200,100,200,38,215,41,1321.39,165,150,50,100,19,0,0],
[2894.02,325,200,0,200,48,215,51.25,1421.39,177.5,150,0,100,24,0,0],
[2894.02,325,200,0,200,48,215,51.25,1421.39,177.5,150,0,100,24,0,0],
[2894.02,325,200,0,200,48,215,51.25,1421.39,177.5,150,0,100,24,0,0],
[2894.02,325,200,0,200,48,215,51.25,1421.39,177.5,150,0,100,24,0,0],
[2894.02,325,200,0,200,48,215,51.25,1421.39,177.5,150,0,100,24,0,0],
[3094.02,325,335,0,220,53,237,57,1520.01,177.5,223,0,110,26.5,0,0],
[3094.02,325,335,0,220,53,237,57,1520.01,177.5,223,0,110,26.5,0,0],
[3249.02,450,390,0,240,58,258,62,1596.51,225,270,0,120,29,0,0],
[3249.02,450,390,0,240,58,258,62,1596.51,225,270,0,120,29,0,0],
[3249.02,450,390,0,240,58,258,62,1596.51,225,270,0,120,29,0,0],
[3399.02,450,390,0,249,60,268,64,1673.51,225,270,0,124.5,30,0,0],
[3399.02,450,390,0,249,60,268,64,1673.51,225,270,0,124.5,30,0,0],
[3399.02,450,390,0,249,60,268,64,1673.51,225,270,0,124.5,30,0,0],
[3399.02,450,390,0,249,60,268,64,1673.51,225,270,0,124.5,30,0,0],
[1848.17,0,0,100,156.2,15.6,169.79,16.9,957.8,0,0,100,78.1,7.8,0,0],
[2020.88,30,0,100,168.65,16.8,183.3,18.3,1014.86,30,0,100,84.32,8.4,0,0],
[2192.01,30,0,100,181.1,18.1,196.87,19.6,1070.38,30,0,100,90.54,9.05,0,0],
[2192.01,30,0,100,181.1,18.1,196.87,19.6,1070.38,30,0,100,90.54,9.05,0,0],
[2192.01,30,0,100,181.1,18.1,196.87,19.6,1070.38,30,0,100,90.54,9.05,0,0],
[2192.01,30,0,100,181.1,18.1,196.87,19.6,1070.38,30,0,100,90.54,9.05,0,0],
[2192.01,30,0,100,181.1,18.1,196.87,19.6,1070.38,30,0,100,90.54,9.05,0,0],
[2192.01,30,0,100,181.1,18.1,196.87,19.6,1070.38,30,0,100,90.54,9.05,0,0],
[2192.01,30,0,100,181.1,18.1,196.87,19.6,1070.38,30,0,100,90.54,9.05,0,0],
[2192.01,30,200,0,181.1,18.1,196.87,19.6,1070.38,30,150,0,90.54,9.05,0,0],
[2192.01,30,200,100,181.1,18.1,196.87,19.6,1070.38,30,150,50,90.54,9.05,0,0],
[2192.01,30,200,200,181.1,18.1,196.87,19.6,1070.38,30,150,100,90.54,9.05,0,0],
[2192.01,30,200,200,181.1,18.1,196.87,19.6,1070.38,30,150,100,90.54,9.05,0,0],
[2192.01,30,200,200,181.1,18.1,196.87,19.6,1070.38,30,150,100,90.54,9.05,0,0],
[2342.01,80,200,200,200,20,215,21.5,1145.38,55,150,100,100,10,0,0],
[2342.01,80,200,200,200,20,215,21.5,1145.38,55,150,100,100,10,0,0],
[2342.01,250,200,300,200,20,215,21.5,1145.38,140,150,150,100,10,0,0],
[2442.01,275,200,200,200,20,215,21.5,1195.38,152.5,150,100,100,10,0,0],
[2442.01,275,200,200,200,20,215,21.5,1195.38,152.5,150,100,100,10,0,0],
[2542.01,275,200,200,200,29,215,31,1245.38,152.5,150,100,100,14.5,0,0],
[2742.01,300,200,100,200,38,215,41,1345.38,165,150,50,100,19,0,0],
[2942.01,325,200,0,200,48,215,51.25,1445.38,177.5,150,0,100,24,0,0],
[2942.01,325,200,0,200,48,215,51.25,1445.38,177.5,150,0,100,24,0,0],
[2942.01,325,200,0,200,48,215,51.25,1445.38,177.5,150,0,100,24,0,0],
[2942.01,325,200,0,200,48,215,51.25,1445.38,177.5,150,0,100,24,0,0],
[2942.01,325,200,0,200,48,215,51.25,1445.38,177.5,150,0,100,24,0,0],
[3142.01,325,335,0,220,53,237,57,1544,177.5,223,0,110,26.5,0,0],
[3142.01,325,335,0,220,53,237,57,1544,177.5,223,0,110,26.5,0,0],
[3297.01,450,390,0,240,58,258,62,1620.5,225,270,0,120,29,0,0],
[3297.01,450,390,0,240,58,258,62,1620.5,225,270,0,120,29,0,0],
[3297.01,450,390,0,240,58,258,62,1620.5,225,270,0,120,29,0,0],
[3447.01,450,390,0,249,60,268,64,1697.5,225,270,0,124.5,30,0,0],
[3447.01,450,390,0,249,60,268,64,1697.5,225,270,0,124.5,30,0,0],
[3447.01,450,390,0,249,60,268,64,1697.5,225,270,0,124.5,30,0,0],
[3447.01,450,390,0,249,60,268,64,1697.5,225,270,0,124.5,30,0,0]];
    
    
/**
         * Function : dump()
         * Arguments: The data - array,hash(associative array),object
         *    The level - OPTIONAL
         * Returns  : The textual representation of the array.
         * This function was inspired by the print_r function of PHP.
         * This will accept some data as the argument and return a
         * text that will be a more readable version of the
         * array/hash/object that is given.
         * Docs: http://www.openjs.com/scripts/others/dump_function_php_print_r.php
         */
function dump(arr,level) {
    var dumped_text = "";
    if(!level) level = 0;
	
    //The padding given at the beginning of the line.
    var level_padding = "";
    for(var j=0;j<level+1;j++) level_padding += "    ";
	
    if(typeof(arr) == 'object') { //Array/Hashes/Objects 
        for(var item in arr) {
            var value = arr[item];
			
            if(typeof(value) == 'object') { //If it is an array,
                dumped_text += level_padding + "'" + item + "' ...\n";
                dumped_text += dump(value,level+1);
            } else {
                dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n";
            }
        }
    } else { //Stings/Chars/Numbers etc.
        dumped_text = "===>"+arr+"<===("+typeof(arr)+")";
    }
    return dumped_text;
}

var mes_nombre=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"];
var meses=["2010 Junio","2010 Julio","2010 Agosto","2010 Septiembre","2010 Octubre","2010 Noviembre","2010 Diciembre","2011 Enero",
"2011 Febrero","2011 Marzo","2011 Abril","2011 Mayo","2011 Junio","2011 Julio","2011 Agosto","2011 Septiembre","2011 Octubre",
"2011 Noviembre","2011 Diciembre","2012 Enero","2012 Febrero","2012 Marzo","2012 Abril","2012 Mayo","2012 Junio","2012 Julio",
"2012 Agosto","2012 Septiembre","2012 Octubre","2012 Noviembre","2012 Diciembre","2013 Enero","2013 Febrero","2013 Marzo","2013 Abril"];
var convenios=["Comercio","Maestranza"];
var categorias=["Maestranza y Servicios: A","Maestranza y Servicios: B","Maestranza y Servicios: C","Administrativo: A",
"Administrativo: B","Administrativo: C","Administrativo: D","Administrativo: E","Administrativo: F","Cajero: A","Cajero: B",
"Cajero: C","Personal Auxiliar: A","Personal Auxiliar: B","Personal Auxiliar: C","Auxiliar Especializado: A",
"Auxiliar Especializado: B","Ventas: A","Ventas: B","Ventas: C","Ventas: D"];
var categorias_maestranza=["Oficial","Oficial de primera","Coordinador A","Coordinador B/of Espec.","Coordinador C"];
var acuerdos=["Adicional no remunerativo 2008-2009","Adicional no remunerativo 2010",
"Adicional no remunerativo 2011","Acuerdo mayo 2012"]

    
var sueldo={
    rem:[
    ["Sueldo basico",false,0],
    ["Antiguedad",0,0],
    ["Presentismo",1/12,0],
    ["Plus asistencia",0,0],
    ["Art 13 C.C.T. Basico",0,0],
    ["Art 28 C.C.T. P. Asist.",0,0],
    ["Horas extras al 50%",false,0],
    ["Horas extras al 100%",false,0]
    ],
    nrem:[
    ["Adicional no remunerativo 2008-2009",false,0],
    ["Adicional no remunerativo 2010",false,0],
    ["Adicional no remunerativo 2011",false,0],
    ["Acuerdo mayo 2012", false, 0],
    ["Retroactivo Acuerdo mayo-2011",false,0],
    ["Retroactivo Acuerdo mayo-2012",false,0],
    ["Presentismo",1/12,0],
    ["Viaticos CCT",false,0],
    ["Asignacion no remunerativa",false,0]
    ],
    desc:[
    ["Jubilacion",0.11,0],
    ["Ley 19032",0.03,0],
    ["Obra social",0.03,0],
    ["Faecys",0.005,0],
    ["Sindicato",0.02,0],
    ["Aporte solidario Obra social","",0],
    ["Aporte solidario Obra social (mayo)","",0]
    ],
    title:"Sueldo"
}
var sac={
    rem:[
    ["SAC",false,0]
    ],
    nrem:[
    ["SAC Adicional no remunerativo 2008-2009",false,0],
    ["SAC Adicional no remunerativo 2010",false,0],
    ["SAC Adicional no remunerativo 2011",false,0],
    ["SAC Adicional no remunerativo 2012",false,0],
    ["SAC Adicional no remunerativo",false,0]
    ],
    desc:[
    ["Jubilacion",0.11,0],
    ["Ley 19032",0.03,0],
    ["Obra social",0.03,0],
    ["Faecys",0.005,0],
    ["Sindicato",0.02,0]
    ],
    title:"Sueldo anual complementario"
}
		
var data={
    sueldo:[0],
    jornada_completa:[0],
    antiguedad:[9],
    presentismo:[true],
    mes:["2011 Diciembre"],
    categoria:["Maestranza y Servicios: A"],
    convenio:["Convenio1"],
    lunes:[9,18,true],
    martes:[9,18,true],
    miercoles:[9,18,true],
    jueves:[9,18,true],
    viernes:[9,18,true],
    sabado:[9,12,false],
    domingo:[9,12,false]
}
		
function cargarDatosComunos(){
    if(document.getElementById('esc_pre').value==1){
        data.presentismo[0]=true;
    }else{
        data.presentismo[0]=false;
    }
    data.antiguedad[0]=document.getElementById('esc_ant').value;
    //limpio
    for(var i=0;i<sueldo.nrem.length;i++){
        sueldo.nrem[i][2]=0;
    }
    for(var i=0;i<sueldo.desc.length;i++){
        sueldo.desc[i][2]=0;
    }
    for(var i=0;i<sac.nrem.length;i++){
        sac.nrem[i][2]=0;
    }
    data.lunes[2] = document.getElementById('day1-check').checked;
    data.lunes[0] = document.getElementById('mon1').value;
    data.lunes[1] = document.getElementById('mon2').value;
    data.martes[2] = document.getElementById('day2-check').checked;
    data.martes[0] = document.getElementById('tue1').value;
    data.martes[1] = document.getElementById('tue2').value;
    data.miercoles[2] = document.getElementById('day3-check').checked;
    data.miercoles[0] = document.getElementById('wed1').value;
    data.miercoles[1] = document.getElementById('wed2').value;
    data.jueves[2] = document.getElementById('day4-check').checked;
    data.jueves[0] = document.getElementById('thu1').value;
    data.jueves[1] = document.getElementById('thu2').value;
    data.viernes[2] = document.getElementById('day5-check').checked;
    data.viernes[0] = document.getElementById('fri1').value;
    data.viernes[1] = document.getElementById('fri2').value;
    data.sabado[2] = document.getElementById('day6-check').checked;
    data.sabado[0] = document.getElementById('sat1').value;
    data.sabado[1] = document.getElementById('sat2').value;
    data.domingo[2] = document.getElementById('day7-check').checked;
    data.domingo[0] = document.getElementById('sun1').value;
    data.domingo[1] = document.getElementById('sun2').value;
}
               
function calcularCantHorasSemanales(){
    var aux = 0;
    
    if(data.lunes[2]){
        aux += parseInt(calcularCantHoras(parseInt(data.lunes[0]),parseInt(data.lunes[1])));
    }
    if(data.martes[2]){
        aux += parseInt(calcularCantHoras(parseInt(data.martes[0]),parseInt(data.martes[1])));
    }
    if(data.miercoles[2]){
        aux += parseInt(calcularCantHoras(parseInt(data.miercoles[0]),parseInt(data.miercoles[1])));
    }
    if(data.jueves[2]){
        aux += parseInt(calcularCantHoras(parseInt(data.jueves[0]),parseInt(data.jueves[1])));
    }
    if(data.viernes[2]){
        aux += parseInt(calcularCantHoras(parseInt(data.viernes[0]),parseInt(data.viernes[1])));
    }
    if(data.sabado[2]){
        aux += parseInt(calcularCantHoras(parseInt(data.sabado[0]),parseInt(data.sabado[1])));
    }
    if(data.domingo[2]){
        aux += parseInt(calcularCantHoras(parseInt(data.domingo[0]),parseInt(data.domingo[1])));
    }
    
    return aux;
}

function calcularCantHoras(hora_min,hora_max){
    if(hora_min<=hora_max){
        return hora_max - hora_min;
    }else{
        return (24 - hora_min) + hora_max;
    }
}

function cargarDatos(){
    data.convenio[0]=convenios[document.getElementById('esc_conv').value];
    data.mes[0]=meses[document.getElementById('esc_mes').value];
    var indexcat;
    var indexmes;
    var horas_semanales = 0;
    if(document.getElementById('esc_conv').value == 0){
        //Comercio
        cargarDivsComercio();
        cargarDatosComunos();
        horas_semanales = calcularCantHorasSemanales()
        
        var indice_jornada = 1;
        if(horas_semanales<36){
            //media jornada
            indice_jornada = 2;
        }
        
        data.categoria[0]=categorias[document.getElementById('esc_cat').value];
        indexcat = categorias.indexOf(data.categoria[0]);
        indexmes = meses.indexOf(data.mes[0]);
        data.sueldo[0] = db[(indexcat*36)+indexmes][0]/indice_jornada;
        data.jornada_completa[0] = db[(indexcat*36)+indexmes][0];
        if(indexmes>5){
            sueldo.rem[1][1] = 0.01*data.antiguedad[0]/indice_jornada;
        }else{
            sueldo.rem[1][1] = 0.0075*data.antiguedad[0]/indice_jornada;
        }
        for(var i=1;i<=5 ;i++){
            if(db[(indexcat*36)+indexmes][i]){
                sueldo.nrem[i-1][2]=db[(indexcat*36)+indexmes][i]/indice_jornada;
                if((data.mes[0].indexOf("Junio") != -1)||(data.mes[0].indexOf("Diciembre") != -1)){
                    sac.nrem[i-1][2]=db[(indexcat*36)+indexmes][i]*0.5/indice_jornada;
                }
            }
        }
        
        sueldo.rem[4][2] = 0;
        sueldo.rem[5][2] = 0;
    }else if(document.getElementById('esc_conv').value == 1){
        //Maestranza
        cargarDivsMaestranza();
        cargarDatosComunos(); 
        horas_semanales = calcularCantHorasSemanales()
        
        var indice_jornada = 0;
        if(horas_semanales<36){
            //media jornada
            indice_jornada = 8;
        }
        
        data.categoria[0]=categorias_maestranza[document.getElementById('esc_cat').value];
        indexcat = categorias_maestranza.indexOf(data.categoria[0]);
        indexmes = meses.indexOf(data.mes[0]);
        data.sueldo[0] = db_maestranza[(indexcat*36)+indexmes][indice_jornada+0];
        data.jornada_completa[0] = db_maestranza[(indexcat*36)+indexmes][0]
        sueldo.rem[1][1] = 0.002*data.antiguedad[0];
        if(data.presentismo[0]){
            sueldo.rem[3][2]=db_maestranza[(indexcat*36)+indexmes][indice_jornada+1];
            if(document.getElementById('maestranza-art-28').checked){
                sueldo.rem[5][2] = db_maestranza[(indexcat*36)+indexmes][indice_jornada+6];
            }else{
                sueldo.rem[5][2] = 0;
            }
        }else{
            sueldo.rem[3][2]=0;
            sueldo.rem[5][2] = 0;
        }
        
        sueldo.nrem[7][2]=db_maestranza[(indexcat*36)+indexmes][indice_jornada+2];
        sueldo.nrem[8][2]=db_maestranza[(indexcat*36)+indexmes][indice_jornada+3];
        if((data.mes[0].indexOf("Junio") != -1)||(data.mes[0].indexOf("Diciembre") != -1)){
            sac.nrem[4][2]=(db_maestranza[(indexcat*36)+indexmes][indice_jornada+2]*0.5)+(db_maestranza[(indexcat*36)+indexmes][indice_jornada+3]*0.5);
        }
        

        if(document.getElementById('maestranza-art-13').checked){
            sueldo.rem[4][2] = db_maestranza[(indexcat*36)+indexmes][indice_jornada+4];
        }else{
            sueldo.rem[4][2] = 0;
        }
    }
    
    sueldo.rem[6][2] = calculoHorasExtraordinariasAl50porciento(data.jornada_completa[0],data);
    //Calculo horas extras
    if(horas_semanales>48){
        sueldo.rem[7][2] = calculoHorasExtraordinariasAl100porciento(data.jornada_completa[0],data,horas_semanales);
    }else{
        sueldo.rem[7][2] = 0;
    }
    
}

function calculoHorasExtraordinariasAl100porciento(sueldo_real, data,cant_horas){

    valor_hora = ((sueldo_real / 30) / 8) * 2;
    cant_horas_extras = (cant_horas)-48;

    return 4 * cant_horas_extras * valor_hora;
}

function calculoHorasExtraordinariasAl50porciento(sueldo_real, data){
    valor_hora = ((sueldo_real / 30) / 8) * 1.5;
    var cant_horas_extras = 0;
    var aux;
    if(data.lunes[2]){
        aux = parseInt(calcularCantHoras(parseInt(data.lunes[0]),parseInt(data.lunes[1])));
        if((aux-9)>0){
            cant_horas_extras += (aux-9);
        }
    }
    if(data.martes[2]){
        aux = parseInt(calcularCantHoras(parseInt(data.martes[0]),parseInt(data.martes[1])));
        if((aux-9)>0){
            cant_horas_extras += (aux-9);
        }
    }
    if(data.miercoles[2]){
        aux = parseInt(calcularCantHoras(parseInt(data.miercoles[0]),parseInt(data.miercoles[1])));
        if((aux-9)>0){
            cant_horas_extras += (aux-9);
        }
    }
    if(data.jueves[2]){
        aux = parseInt(calcularCantHoras(parseInt(data.jueves[0]),parseInt(data.jueves[1])));
        if((aux-9)>0){
            cant_horas_extras += (aux-9);
        }
    }
    if(data.viernes[2]){
        aux = parseInt(calcularCantHoras(parseInt(data.viernes[0]),parseInt(data.viernes[1])));
        if((aux-9)>0){
            cant_horas_extras += (aux-9);
        }
    }
    if(cant_horas_extras>0){
        return 4 * cant_horas_extras * valor_hora;
    }else{
        return 0;
    }
}
		
function generarDatos(){
    var ret=[sueldo,false];
    var indexmes = meses.indexOf(data.mes[0]);
    sueldo.rem[0][2]=data.sueldo[0];
    sueldo.rem[1][2]=data.sueldo[0]*sueldo.rem[1][1];
    if(data.convenio[0]==0){
        //Es comercio, muestro presentismo
        sueldo.rem[2][2]=data.presentismo[0]?(sueldo.rem[0][2]+sueldo.rem[1][2])/12:0;
    }
    sueldo.rem.total=total(sueldo.rem);
			
    sueldo.nrem[6][2]=data.presentismo[0]?(sueldo.nrem[0][2]+sueldo.nrem[1][2]+sueldo.nrem[2][2]+sueldo.nrem[3][2]+sueldo.nrem[4][2]+sueldo.nrem[5][2])/12:0;
    sueldo.nrem.total=total(sueldo.nrem);
			
    sueldo.desc[0][2]=sueldo.desc[0][1]*sueldo.rem.total;
    sueldo.desc[1][2]=sueldo.desc[1][1]*sueldo.rem.total;
    sueldo.desc[2][2]=sueldo.desc[2][1]*(sueldo.rem.total+sueldo.nrem.total);
    sueldo.desc[3][2]=sueldo.desc[3][1]*(sueldo.rem.total+sueldo.nrem.total);
    sueldo.desc[4][2]=sueldo.desc[4][1]*(sueldo.rem.total+sueldo.nrem.total);
    if(data.convenio[0] == "Comercio"){
        sueldo.desc[5][2]=(indexmes==0||indexmes==12||indexmes==13)?50:(indexmes==23?100:0);
    }
    //sueldo.desc[6][2]=mes==24&&retro?100:0;
    sueldo.desc.total=total(sueldo.desc);
			
			
    if((data.mes[0].indexOf("Junio") != -1)||(data.mes[0].indexOf("Diciembre") != -1)){
        ret[1]=sac;
                
        sac.rem[0][2]=sueldo.rem.total*0.5;
        sac.rem.total=total(sac.rem);
                
        sac.nrem[0][2]=sueldo.nrem[0][2]*(1+(data.presentismo[0]?1/12:0))*0.5;
        sac.nrem[1][2]=sueldo.nrem[1][2]*(1+(data.presentismo[0]?1/12:0))*0.5;
        sac.nrem[2][2]=sueldo.nrem[2][2]*(1+(data.presentismo[0]?1/12:0))*(indexmes==12?2/12:0.5);
        sac.nrem[3][2]=sueldo.nrem[3][2]*(1+(data.presentismo[0]?1/12:0))*(indexmes==24?2/12:0.5);
        sac.nrem.total=total(sac.nrem);
                
        sac.desc[0][2]=sac.desc[0][1]*sac.rem.total;
        sac.desc[1][2]=sac.desc[1][1]*sac.rem.total;
        sac.desc[2][2]=sac.desc[2][1]*(sac.rem.total+sac.nrem.total);
        sac.desc[3][2]=sac.desc[3][1]*(sac.rem.total+sac.nrem.total);
        sac.desc[4][2]=sac.desc[4][1]*(sac.rem.total+sac.nrem.total);
        sac.desc.total=total(sac.desc); 
    }
    function total(obj){
        var ret=0;
        for(var i=0;i<obj.length;i++){
            ret+=obj[i][2];
        }
        return ret;
    }
	
    return ret;
}
		
function calculateRecibo(){
    cargarDatos();
    var datos = generarDatos();
    var table = document.getElementById('bodyRecibo');
    while (table.hasChildNodes()) {
        table.removeChild(table.lastChild);
    }
    var w = 0;
    var suma=[0,0,0];
    for(var i=0;i<datos.length;i++){
        if(datos[i]){
            w = 0;
            for(var det in datos[i]){
                if(!/obj|title/.test(det)){
                    for(var j=0;j<datos[i][det].length;j++){
                        if(datos[i][det][j]){
                            if(datos[i][det][j][2]){
                                var newdiv = document.createElement('tr');
                                newdiv.innerHTML = '<td>'+datos[i][det][j][0]+'</td>';
                                if(datos[i][det][j][1]){
                                    newdiv.innerHTML = newdiv.innerHTML+'<td>'+(datos[i][det][j][1]*100).toFixed(2)+'%</td>';
                                }else{
                                    newdiv.innerHTML = newdiv.innerHTML+'<td></td>';
                                }
                                    
                                for(var q=0; q<=2 ; q++){
                                    if(q==w){
                                        newdiv.innerHTML = newdiv.innerHTML+ '<td>'+(datos[i][det][j][2]).toFixed(2)+'</td>';
                                    }else{
                                        newdiv.innerHTML = newdiv.innerHTML+ '<td></td>';
                                    }
                                }
                                table.appendChild(newdiv);
                            }
                        }
                    }
                    w++;
                }
            }	
            var totaldiv = document.createElement('tr');
            if(datos.length>1){
                totaldiv.setAttribute("class", "tr2");
                totaldiv.innerHTML = '<td>Subtotal</td><td></td>';
            }else{
                totaldiv.setAttribute("class", "tr1");
                totaldiv.innerHTML = '<td>Total</td><td></td>';
            }
                    
            totaldiv.innerHTML = totaldiv.innerHTML + '<td>'+(datos[i].rem.total).toFixed(2)+'</td>';
            totaldiv.innerHTML = totaldiv.innerHTML + '<td>'+(datos[i].nrem.total).toFixed(2)+'</td>';
            totaldiv.innerHTML = totaldiv.innerHTML + '<td>'+(datos[i].desc.total).toFixed(2)+'</td>';
            table.appendChild(totaldiv);
            suma[0]+=datos[i].rem.total;
            suma[1]+=datos[i].nrem.total;
            suma[2]+=datos[i].desc.total;
        }
    }
    if(datos.length>1){
        var totaldiv = document.createElement('tr');
        totaldiv.setAttribute("class", "tr1");
        totaldiv.innerHTML = '<td>Total</td><td></td>';
        totaldiv.innerHTML = totaldiv.innerHTML + '<td>'+(suma[0]).toFixed(2)+'</td>';
        totaldiv.innerHTML = totaldiv.innerHTML + '<td>'+(suma[1]).toFixed(2)+'</td>';
        totaldiv.innerHTML = totaldiv.innerHTML + '<td>'+(suma[2]).toFixed(2)+'</td>';
        table.appendChild(totaldiv);
    }
    var totalfull = document.createElement('tr');
    totalfull.innerHTML = '<td>Sueldo neto a cobrar</td><td></td><td></td><td></td><td>'+(suma[0]+suma[1]-suma[2]).toFixed(2)+'</td>';
    table.appendChild(totalfull);
}

function loadSelectDays(){
    checkDay('day1-check');
    checkDay('day2-check');
    checkDay('day3-check');
    checkDay('day4-check');
    checkDay('day5-check');
    loadSelectDay('mon1',9);
    loadSelectDay('mon2',18);
    loadSelectDay('tue1',9);
    loadSelectDay('tue2',18);
    loadSelectDay('wed1',9);
    loadSelectDay('wed2',18);
    loadSelectDay('thu1',9);
    loadSelectDay('thu2',18);
    loadSelectDay('fri1',9);
    loadSelectDay('fri2',18);
    loadSelectDay('sat1',0);
    loadSelectDay('sat2',0);
    loadSelectDay('sun1',0);
    loadSelectDay('sun2',0);
}

function checkDay(day){
    var select = document.getElementById(day);
    select.checked = true;
}

function loadSelectDay(selectId,selectedDay){
    var select = document.getElementById(selectId);
    for(var i=0;i<=23;i++){
        var option = document.createElement('option');
        option.setAttribute("value", i);
        if(selectedDay==i){
            option.setAttribute('selected', 'selected');
        }
        option.innerHTML = i+' hs';
        select.appendChild(option);
    }
}

function cambiarCategorias(){
    id_conv = document.getElementById('esc_conv').value
    if(id_conv == 0){
        //Comercio
        var table = document.getElementById('esc_cat');
        while (table.hasChildNodes()) {
            table.removeChild(table.lastChild);
        }
        for(var i=0;i<categorias.length;i++){
            var totaldiv = document.createElement('option');
            totaldiv.setAttribute("value", i);
            totaldiv.innerHTML = categorias[i];
            table.appendChild(totaldiv);
        };     
    }else if(id_conv == 1){
        //Maestranza
        table = document.getElementById('esc_cat');
        while (table.hasChildNodes()) {
            table.removeChild(table.lastChild);
        }
        for(var i=0;i<categorias_maestranza.length;i++){
            var totaldiv = document.createElement('option');
            totaldiv.setAttribute("value", i);
            totaldiv.innerHTML = categorias_maestranza[i];
            table.appendChild(totaldiv);
        };     
    }
    calculateRecibo();
}

function cargarDivsComercio(){
    document.getElementById('maestranza-art').style.display = 'none';
}

function cargarDivsMaestranza(){
    document.getElementById('maestranza-art').style.display = 'block';
}

function selectMoth(){
    var aux = "2013 Abril";
    try{
        aux = d.getFullYear()+" "+mes_nombre[d.getMonth()];
    }catch(err){
    }
    var d = new Date();
    var select = document.getElementById("esc_mes").options[meses.indexOf(aux)];
    select.setAttribute('selected', 'selected');
}